<template>
  <ul class="list">
    <li v-for="(item, index) of list"
      :key="index"
      class="ticket-item">
      <div class="ticket-title border-bottom">
        <span class="ticket-title-icon"></span>
        {{ item.title }}
      </div>
      <div v-if="item.children">
        <detail-list :list="item.children" class="ticket-children"></detail-list>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  name: 'DetailList',
  props: {
    list: {
      type: Array
    }
  }
}
</script>

<style lang="stylus" scoped>
  .list
    background #fff
    margin .2rem 0
    .ticket-title
      line-height .8rem
      font-size .32rem
      padding-left .2rem
      .ticket-title-icon
        display inline-block
        position relative
        left .06rem
        top .06rem
        width .36rem
        height .36rem
        background url(http://s.qunarzz.com/piao/image/touch/sight/detail.png) 0 -0.45rem no-repeat
        margin-right .1rem
        background-size .4rem 3rem
    .ticket-children
      padding 0 .2rem
</style>
